@extends('admin.layout.master')
@section('content-header')
<section class="content-header">
    <h1>
        添加文章
        <small>{{link_to_route('admin.posts.create','添加文章')}}</small>
    </h1>
    <ol class="breadcrumb">
        <i class="fa fa-dashboard"></i><li><a href="#"> 首页</a></li>
        <li class="active">所有文章</li>
    </ol>
</section>
@stop

@section('content')
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-body table-responsive no-padding">
                <table class="table table-hover">
                    <tbody><tr>
                        <th>ID</th>
                        <th>标题</th>
                        <th>状态</th>
                        <th>发布时间</th>
                        <th>更新时间</th>
                        <th>操作</th>
                    </tr>
                    @foreach($posts as $post)
                    <tr>
                        <td>{{$post->id}}</td>
                        <td>{{link_to_route('admin.posts.edit',$post->title,$post->id)}}</td>
                        <td>{{$post->status}}</td>
                        <td>{{$post->created_at}}</td>
                        <td>{{$post->updated_at}}</td>
                        <td>
                        	{{Form::open(array('method'=>'DELETE','route' => array('admin.posts.destroy',$post->id)))}}
                        	{{Form::submit('删除',['class'=>'btn btn-danger btn-sm'])}}
                        	{{Form::close()}}</td>
                    </tr>
                    @endforeach
                    
                </tbody></table>
               {{$posts->links()}}
            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </div>
</div>
@stop